<script setup>
import { ref, reactive } from "vue";
import store from "@/store";
</script>

<template>
  <!-- 概览 -->
  <div class="home-overview">
    <!-- 用户信息 -->
    <div class="user-meta">
      <div class="avatar">
        <img :src="store.state.userInfo.avatar" />
      </div>
      <h4>
        {{ store.state.userInfo.nickname || store.state.userInfo.account }}
      </h4>
    </div>
    <div class="item">
      <a href="javascript:;">
        <span class="iconfont icon-crown"></span>
        <p>会员中心</p>
      </a>
      <a href="javascript:;">
        <span class="iconfont icon-setting"></span>
        <p>安全设置</p>
      </a>
      <router-link to="/member/address">
        <span class="iconfont icon-location"></span>
        <p>地址管理</p>
      </router-link>
    </div>
  </div>
</template>

<style scoped lang='less'>
.home-overview {
  height: 132px;
  background: url(https://images.pexels.com/photos/2249527/pexels-photo-2249527.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500)
    no-repeat center / cover;
  object-fit: cover;
  display: flex;
  .user-meta {
    flex: 1;
    display: flex;
    align-items: center;
    .avatar {
      width: 85px;
      height: 85px;
      border-radius: 50%;
      overflow: hidden;
      margin-left: 60px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    h4 {
      padding-left: 26px;
      font-size: 18px;
      font-weight: normal;
      color: white;
    }
  }
  .item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-around;
    &:first-child {
      border-right: 1px solid #f4f4f4;
    }
    a {
      color: white;
      font-size: 15px;
      text-align: center;
      .iconfont {
        font-size: 30px;
      }
      p {
        line-height: 32px;
      }
    }
  }
}
</style>